package com.webservicedemo.config;

import org.glassfish.jersey.servlet.ServletContainer;
import org.glassfish.jersey.servlet.ServletProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JerseyConfig {
	@Bean
    public ServletRegistrationBean jerseyServlet(){
    	//设置服务的请求路径
    	ServletRegistrationBean bean = new ServletRegistrationBean(new ServletContainer(),"/rest/*");
    	//(Jersey servlet容器配置属性,前面配置的扫描包的类);
    	bean.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerserResourceRegistConfig.class.getName());
    	return bean;
    }
    
}
